<script setup>
import { onMounted } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { loginFromServer } from '@/api/login';
import { loginSuccess} from '@/utils/login'
const route=useRoute()
const router = useRouter()
onMounted(async ()=>{
  let code = route.query.code
  //前四个是账号，密码，手机号，验证码，后端都用同一个接口
  let res =await loginFromServer('','','','',code)
  if(res.data.code===1){
    loginSuccess(res)
  }
  else router.push('/login')
})
</script>
<template>
  <div></div>
</template>


<style scoped>
</style>